package org.phalanx.servlet.websession;

import org.phalanx.server.PhalanxServer;

public class ServerThreadLoader extends Thread {
	PhalanxServer pServer;
	
	public ServerThreadLoader(PhalanxServer pServer){
		this.pServer = pServer;
		this.setName(this.getClass().getSimpleName());
	}
	
	public void startServer(){
		start();
	}
	
	public void run(){
		String mapDir = this.getClass().getResource("/resources/maps").getPath();
		String cacheDir = this.getClass().getResource("/resources/tileset/cache").getPath();
		String defaultTileSet = this.getClass().getResource("/resources/tileset/defaulttileset.zip").getPath();
		
		pServer.setMapProperties(cacheDir, mapDir, defaultTileSet);
		pServer.setRootDirectory(this.getClass().getResource("/resources").getPath());
		pServer.init();
	}
}
